<?php

/**
 * uploadCSV actions.
 *
 * @package    ecrm
 * @subpackage uploadCSV
 * @author     Saul Santiago
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class uploadCSVActions extends sfActions
{
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
  public function executeIndex(sfWebRequest $request)
  {
    
  }
  
  public function executeUpload(sfWebRequest $request)
  {
  	$files = $request->getFiles();
		$this->forward404Unless($files['csvfile']);
  	$csvFile = $files['csvfile'];

  	if (($handle = fopen($csvFile['tmp_name'], "r")) !== FALSE) {
  		var_dump(fgetcsv($handle));
  		fclose($handle);
  	}
  	exit();
  }
  
  
}
